<template>
    <van-nav-bar title="消费记录" left-text="" left-arrow @click-left="goBack" />
    <div class="order-info" v-for="item in spend">
        <p style="width: 200px;">{{ item.content }}</p>
        <p >{{ item.createtime }}</p>
    </div>
</template>
<script setup>
    const { proxy } = getCurrentInstance()
    const goBack = () => { proxy.$router.push('/business/index') }
    const LoginUser = reactive(proxy.$cookies.get('LoginUser') ? proxy.$cookies.get('LoginUser') : {})
    const spend = ref([])

    onBeforeMount(() => {
        getspendrecord()
    })

    let getspendrecord = async () => {
    let result = await Api.spendrecord({
        busid: LoginUser.id
    });

    if (result.code == 1) {
        spend.value = result.data
    }
}

</script>
<style scoped>
    .order-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-family: Arial, sans-serif;
        border-bottom: 1px solid #e6e6e6;
        padding: 10px;
        margin: 0 20px;
        border-radius: 5px;
    }

    .order-info p {
        margin: 5px 0;
    }
</style>
